package cn.iocoder.yudao.module.biz.dal.mysql.contract.transformer;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;

import cn.iocoder.yudao.module.biz.dal.dataobject.contract.transformer.TransformerDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.biz.controller.admin.contract.transformer.vo.*;

/**
 * 合同档案-变压器 Mapper
 *
 * @author 超级管理员
 */
@Mapper
public interface TransformerMapper extends BaseMapperX<TransformerDO> {

    default PageResult<TransformerDO> selectPage(TransformerPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<TransformerDO>()
                .eqIfPresent(TransformerDO::getContractArchiveId, reqVO.getContractArchiveId())
                .eqIfPresent(TransformerDO::getVolume, reqVO.getVolume())
                .eqIfPresent(TransformerDO::getAmount, reqVO.getAmount())
                .betweenIfPresent(TransformerDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(TransformerDO::getId));
    }

    void deleteByContractArchiveId(Long contractArchiveId);
}
